Capitalize first word in deletion blocker messages#19133
Open
mmikkel wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A couple of the strings added for the deletion blocker feature in 5.10 begin with an element type name produced by
lowerDisplayName()andpluralLowerDisplayName(). When the count is 1, the sentence starts with a lowercase word. In English this goes unnoticed because the strings are prefixed with'The', but languages without an article render a sentence starting in lowercase.For example, in Norwegian the message renders as:
artikkel er relatert til 1 annen artikkel.Wrapping each formatted message in
StringHelper::upperCaseFirst()capitalizes the first letter regardless of locale, fixing the casing without affecting the element type names elsewhere in the sentence.Again, examples in Norwegian:
Before:

After:

As a side note: even with this fix, the Norwegian translation specifically, isn't quite grammatically correct 🫠 The element type names are inserted in their indefinite base form ("artikkel", "relasjon"), but in these sentences Norwegian would use the definite form ("artikkelen", "relasjonen") — equivalent to the English "The article…" / "The relation…".
I don't think his can be solved in the static translation itself, because the ICU message string only receives the base form of the name and has no way to derive the definite form (the suffix varies by gender and inflection: artikkel → artikkelen, side → siden, produkt → produktet). I'm guessing this problem would have to be addressed in the code, e.g. by passing the definite form as a separate value. I'm unsure how to best approach that, though – but, just thought I'd mention it.
(FWIW, I'm also submitting some proposed changes to the Norwegian translations in Crowdin, that should help improve the above situation a little bit 😃)
Related issues